<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }
        
        #nbaPlay {
            width: 250px;
            /* 实现居中 */
            margin: auto;
        }
        
        #curry,
        #abc {
            float: left;
            height: 178px;
            width: 112px;
            border: 1px rgba(0, 0, 0, 0.12) solid;
            margin: 5px;
        }
        
        .teamImg,.teamImg2 {
            width: 16px;
            height: 16px;
        }
        
        #abc,
        #abcImg,
        #curry,
        #curryImg {
            border-radius: 10px;
            text-align: center;
        }
        
        .name.name2 {
            font-size: 14px;
        }
        
        .team,
        .type,
        .team2,
        .type2 {
            font-size: 12px;
            color: #70757a;
        }
    </style>
</head>

<body>
    <!-- 整体架构:一个大div(控制居中) width:250px
套两个div(人物信息) 
人物卡边框border:rgba(0, 0, 0, .12) solid 1px
卡牌大小： height: 178px;width: 112px;
两个人物卡间隔：10px
人物图片大小：112X112；
队logo大小：16X16；
人物图片、人物卡边角：border-radius: 10px; 
字体样式：文本居中；curry :font-size: 14px;
控球后卫、金州勇士：font-size: 12px; color: #70757a; -->
    <div id="nbaPlay">
        <div id="curry">
            <img src="" alt="" id="curryImg">
            <br><span class="name"></span><br>
            <span class="type"></span><br>
            <img src="" class="teamImg" alt=""><span class="team"></span>
        </div>
        <div id="abc">
            <img src="" alt="" id="abcImg">
            <br><span class="name2"></span><br>
            <span class="type2"></span><br><img src="" class="teamImg2" alt="">
            <span class="team2"></span>
        </div>
        <p align="center"> &copy; 版权由蒋杵峻归属，未经允许不得复制、镜像</p>
    </div>
</body>
<script>
    // 动态数据加载 
    //球员构造函数 personImg, name, type, team, teamImg
function Star(name,type,team,personImg,teamImg){
        this.name=name;
        this.type=type;
        this.team=team;
        this.personImg=personImg;
        this.teamImg=teamImg;}
    //实例化对象 curry
var curry = new Star('curry','控球后卫','金州勇士','img/curryImg.jpg','img/curryTeamImg.png');
//页面动态赋值
     
     var personImag = document.getElementById('curryImg');
     personImag.src = curry.personImg;
     var playName = document.getElementsByClassName('name');
     playName[0].innerHTML = curry.name;
     var type = document.getElementsByClassName('type');
     type[0].innerHTML = curry.type;
     var teamImg = document.getElementsByClassName('teamImg');
     teamImg[0].src = curry.teamImg;
     var team = document.getElementsByClassName('team');
     team[0].innerHTML = curry.team;


    //实例化对象 ABC
    var abc = new Star('abc','字母哥','前锋','img/abcImg.jpg','img/abcTeamImg.png');

    //页面动态赋值
     var personImag2 = document.getElementById('abcImg');
     personImag2.src = abc.personImg;
     var playName2 = document.getElementsByClassName('name2');
     playName2[0].innerHTML = abc.name;
     var type2 = document.getElementsByClassName('type2');
     type2[0].innerHTML = abc.type;
     var teamImg2 = document.getElementsByClassName('teamImg2');
     teamImg2[0].src = abc.teamImg;
     var team2 = document.getElementsByClassName('team2');
     team2[0].innerHTML = abc.team;
    
</script>


</html>